g08aaf
g08aaf
© Numerical Algorithms Group, 2002.
Purpose
G08AAF Sign test on two paired samples
Synopsis
[is,n1,p,ifail] = g08aaf(x,y<,ifail>)
Description
The Sign test investigates the median difference between pairs of
scores from two matched samples of size n, denoted by {x ,y },
i i
for i=1,2,...,n. The hypothesis under test, H , often called the
0
null hypothesis, is that the medians are the same, and this is to
be tested against a one- or two-sided alternative H (see below).
1
G08AAF computes:
(a) The test statistic S, which is the number of pairs for
which x <y ;
i i
(b) The number n of non-tied pairs (x /=y );
1 i i
(c) The lower tail probability p corresponding to S (adjusted
to allow the complement (1-p) to be used in an upper 1-
tailed or a 2-tailed test). p is the probability of
1
observing a value <= S if S< -n ; or of observing a value <
2 1
1 1
S if S> -n , given that H is true. If S= -n , p is set to
2 1 0 2 1
0.5.
Suppose that a significance test of a chosen size (alpha) is to
be performed (i.e., (alpha) is the probability of rejecting H
0
when H is true; typically (alpha) is a small quantity such as 0.
0
05 or 0.01). The returned value of p can be used to perform a
significance test on the median difference, against various
alternative hypotheses H , as follows:
1
(i) H : median of x /= median of y. H is rejected if
1 0
2*min(p,1-p)<(alpha).
(ii) H : median of x> median of y. H is rejected if p<(alpha).
1 0
(iii) H : median of x< median of y. H is rejected if 1-p<(alpha)
1 0
Parameters
g08aaf
Required Input Arguments:
x (:) real
y (:) real
Optional Input Arguments: <Default>
ifail integer -1
Output Arguments:
is integer
n1 integer
p real
ifail integer